{template admin_improt}
<script>


function checkAlluser(form, name) {
	for(var i = 0; i < form.elements.length; i++) {
		var e = form.elements[i];
		if(e.name.match(name)) {
			e.checked = form.elements['chkall'].checked;
		}
	}
}
function check(){
	 returns = false;
	var titles = document.getElementById('titles').value;
	var contents = document.getElementById('contents').value;
	if(titles=='' || contents=='')
	{
		alert('请填写发送标题和内容！');
	}else{
		returns = true;
	}
	return returns;
	
	}


</script>

<div class="mainStyle">
	<div class="mainTitle">
		<span class="mainTitle_text">
	  		站内信管理 &nbsp; &nbsp;<a href="?p=in_mail&a=list">站内信列表</a>
		</span>
	</div>
	<div><p style="color:red; font-size:12px;">*（发送系统消息搜索的会员都是有效会员，无效会员不显示）</p></div>
	<div class="mainSearch">
		<form action="admin.php?p=in_mail" method="post">
			<div class="mainTitle_btn">
			<span style="font-size:12px;">搜索方式：</span>
				<span>
					<select name="user_leve">
						<option value="" selected>▼会员等级</option>
							<option value="1"  {if $user_leve == "1"}selected{/if}>普通会员</option>
							<option value="2"  {if $user_leve == "2"}selected{/if}>商品会员</option>
							<option value="3"  {if $user_leve == "3"}selected{/if}>VIP会员</option>
					</select>
				</span>
			</div>
			<div class="mainSearch_text">
						<input type='hidden' name='search' id='search' value='search' />
				<span><input type="submit" value="搜索" /></span>
			</div>
		</form>
	
	</div>
	<div><p style="color:red; font-size:12px;">*（发送系统消息最少指定一名会员）</p></div>

	<form id="f_form" name="f_form" action="admin.php?p=in_mail" method="post" onsubmit="return check()">
	<!--{if $list}-->
		<!--{loop $list $nl}-->
		<div class="mainList" style="float:left; margin-left:4px; background:pink;">
			
			<span ><input type="checkbox" name="ids[]" value="{$nl['id']}"><!--{$nl["user_name"]}--></span>
			
		</div>
		

		<!--{/loop}-->
			<div style="padding-top:10px;width:100%;">
				<div style="padding-left:30px;font-size:12px;">
					<div style="float:left;display:inline;margin-top:2px;"><input type="checkbox" id="chkall" name="chkall" onclick="checkAlluser(this.form,'ids')"></div>
					<div style="float:left;display:inline;margin-top:6px;">全选</div>
				</div>
			</div>
			<div style="width:100%;text-align:right;"><div class="pages" ><!--{if $pagecount}--><!--{loop $pagecount $pageLinkText}-->{$pageLinkText}<!--{/loop}--><!--{/if}--></div></div>
		<!--{else}-->
		<div style="width:100%;text-align:center;font-size:12px;padding:40px 0px;">暂无内容!</div>
	<!--{/if}-->

	<div>
		<span  style="font-size:12px;">系统消息标题：</span><input type='text' name='titles' id='titles' value='$titles' size='30px;'/>
		<span  style="font-size:12px;">系统消息内容：</span><textarea name="contents" id="contents" cols="30" rows='5'></textarea>
		<input type='hidden' name='a' value='send_mail'/>
		<input type='submit' name='sub1' id='sub1' value='发送' />
	</div>

	</form>
</div>

<div id='infos'></div>
{template admin_bottom}
